/* Copyright (c) 2025 Beijing Semidrive Technology Corporation
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/********************************************************
 *        Copyright(c) 2020    Semidrive                *
 *        All rights reserved.                          *
 ********************************************************/

#ifdef __cplusplus
extern "C" {
#endif

#include "regs_base.h"
#include "I2c.h"

#define I2C_START_SEC_CONST_UNSPECIFIED
#include "I2c_MemMap.h"




CONST(I2c_adap_cfg_t, I2C_CONST) I2c_ChannelCfg[I2C_CHN_NUM] = {
    {
        /* I2c base address */
        .base = (uint32)APB_I2C4_BASE,

        .hwCh = I2C_ID_4,

        /* Clk */
        .clk = (uint32)133330000,

        /* Channel Enable */
        .enable = (I2c_chan_en_t)I2C_EN,

        /* OperatingMode */
        .opmode = (I2c_opmode_t)I2C_MASTER,

        /* Channel Baud Rate */
        .speed = (I2c_speed_t)I2C_SSPEED,

        /* AddressBitConfiguration */
        .addr_flag = (I2c_addr_bits_t)I2C_ADDR7B,

        /* Transfer Mode polling/irq/mainfunction */
        .polling = (I2c_trans_mod_t)I2C_INTR_MOD,

        .i2cCoreId = (uint8)0X00U,

        /* I2C Intr Notification */
        .I2cNotification = NULL_PTR,
        /* I2C Stuck on timeout */
        .timStuck = (uint32)500,

        /* I2C Risetime of SCL */
        .timSclh = (uint32)150,

        /* I2C Risetime of SCL (Hs) */
        .timSclh_hs = (uint32)0

    },
};



#define I2C_STOP_SEC_CONST_UNSPECIFIED
#include "I2c_MemMap.h"

#ifdef __cplusplus
}
#endif
